package ua.org.nuos.sdms.crypt;

import org.mindrot.jbcrypt.BCrypt;

/**
 * Created with IntelliJ IDEA.
 * User: dio
 * Date: 17.06.12
 * Time: 13:54
 * To change this template use File | Settings | File Templates.
 */
public class BCipher implements Cipher {

    @Override
    public String cipher(String value) {
        return BCrypt.hashpw(value, BCrypt.gensalt());
    }

    @Override
    public boolean check(String value, String hash) {
        return BCrypt.checkpw(value, hash);
    }
}
